package com.e3.basdoc.dept.client;

import com.e3.basdoc.dept.model.DeptModel;
import com.e3.template.tgf.TGFEditorDialog;
import com.e3.template.tgf.TGFFormPanel;
import com.e3.web.core.client.GwtAsyncCallback;
import com.google.gwt.user.client.Element;

public class DeptEditorDialog extends TGFEditorDialog<DeptModel> {
	
	private DeptRPCServiceAsync service = DeptRPCService.Util.getInstance();
	
	@Override
	protected void onRender(Element parent, int pos) {
		super.onRender(parent, pos);
		setSize(560, 600);
	}

	@Override
	public TGFFormPanel<DeptModel> createFormPanel() {
		return new DeptFormPanel();
	}

	@Override
	public void executeNewService(DeptModel model,GwtAsyncCallback<DeptModel> callback) {
		service.newDept(model, callback);
	}

	@Override
	public void executeModifyService(DeptModel model,GwtAsyncCallback<DeptModel> callback) {
		service.modifyDept(model, callback);
	}

	@Override
	public String[] getNotNullFieldNames() {
		return DeptHelper.INSTANCE.getNotNullFieldNames();
	}

}
